DROP PROCEDURE IF EXISTS CREATE_Function;

DELIMITER $$

CREATE PROCEDURE CREATE_Function()
BEGIN
<#list FunctionMySQL as f>
    <#if f.getMySQL()??>
        BEGIN
            DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
            BEGIN
                GET CURRENT DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO, @msg = MESSAGE_TEXT;
                select @errno,@msg;
            END;
            ${f.getMySQL()};
        END;
    </#if>
</#list>
END;
CALL CREATE_Function;
DROP PROCEDURE CREATE_Function;

$$
